package com.manlu.mapper;

import com.manlu.pojo.InterviewQuestions;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import tk.mybatis.mapper.common.Mapper;

import java.util.List;

@org.apache.ibatis.annotations.Mapper
public interface InterviewQuestionsMapper extends Mapper<InterviewQuestions> {
    /**
     * 根据分类 查询面试题列表
     *
     * @param cid 分类id
     * @return
     */
    @Select("select * from interview_questions where c_id = #{cid}")
    List<InterviewQuestions> selectAllByPageInfo(@Param("cid") Integer cid);

    /**
     * 根据分类id查询面试题数量
     *
     * @param cid 分类id
     * @return
     */
    @Select("select count(c_id) from interview_questions where c_id = #{cid} and issue_state = 2 ")
    Integer selectCategoryCountByCid(@Param("cid") Integer cid);
}
